﻿@{
    ViewBag.Title = "Ins";
}
@section scripts
{   
    <link href="~/Scripts/miniui/themes/default/medium-mode.css" rel="stylesheet" type="text/css" />       
    <script src="@Url.Content("~/Scripts/shared/share.js?v=")@ViewBag.version" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/shared/shown.js?v=")@ViewBag.version" type="text/javascript"></script>  
    <script src="@Url.Content("~/Scripts/Bill/Bill.js?v=")@ViewBag.version" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Bill/scan.js?v=")@ViewBag.version" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/common/Print.js?v=")@ViewBag.version" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/zxx.drag.1.0.js")" type="text/javascript"></script>
        <style type="text/css">
        .window-mask {
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                height: 100%;
                filter: alpha(opacity=40);
                opacity: 0.40;
                font-size: 1px;
                overflow: hidden;
                display:none;
                background-color: gray;
            }
    </style>

}
<body>
   <form id="form1" runat="server" method="post" style="height: 100%">
    <div class="mini-toolbar" style="padding:2px;border-top:0;border-left:0;border-right:0;"> 
        <table width = "1000px;">
            <tr>
                <td width = "1000px;">
                    <a class="mini-button" id="new" name="new" iconCls="icon-new" onclick="newBills" plain="true" visible="@ViewBag.save">新增</a>
                    <a class="mini-button" id="save" name="save" iconCls="icon-save" onclick="saveBill" plain="true" visible="@ViewBag.save">保存</a>                
                    <a class="mini-button" id="addrow" name="addrow" iconCls="icon-addnew" onclick="addRow" plain="true" visible="@ViewBag.save">增行</a>
                    <a class="mini-button" id="delrow" name="delrow" iconCls="icon-remove" onclick="removeRow" plain="true" visible="@ViewBag.save">删行</a>
                    <a class="mini-button" id="modify" name="modify" iconCls="icon-edit" onclick="modifys" plain="true" visible="@ViewBag.save">改单</a>
                    <a class="mini-button" id="check" name="check" iconCls="icon-ok" onclick="checkBill" plain="true" visible="@ViewBag.check">审核</a>
                    <a class="mini-menubutton" plain="true" iconCls="icon-expand" menu="#popupMenu" visible="@ViewBag.save">选项</a>
                    <a class="mini-button" id="print" iconCls="icon-print" onclick="printBillMyseft" plain="true" visible="@ViewBag.print">打印</a>
                    <a class="mini-button" id="getdata" iconCls="icon-collapse" onclick="getBillData" plain="true">浏览</a>
                    <span class="separator"></span>
                    <a class="mini-button" id="close" iconCls="icon-close" onclick="CloseWindowBill" plain="true">关闭</a>
                </td>
            </tr>
        </table>
    </div>
    
    <div id = "DivHeader">
        <table style="width:770px;">
            <tr>
                <td width ="80px" align="right">客户名称：</td>
                <td width ="190px">    
                    @Html.Partial("~/Views/Modular/LookupCustInfo.cshtml")                       
                </td>
                <td width ="80px" align="right">开单日期：</td>
                <td width ="190px">    
                    <input name="FDate" class="mini-datepicker" style="width:190px;"/>
                </td>
                 <td width ="80px" align="right">单据编号：</td>
                 <td width ="150px">    
                    <input name="FBillNo" class="mini-textbox" required="true"readonly="readonly"style="width:150px;"/>
                 </td>
            </tr>
            <tr>
                <td align="right">销售订单：</td>
                <td >
                    <input id="FScBillNo" name ="FScBillNo" class="mini-buttonedit"  style="width:199px;"  onbuttonclick="onGetSourceBill"/> 
                </td>
                <td align="right">单据备注：</td>                    
                <td >  
                    <input name="FRemark" class="mini-textbox"  style="width:190px;"/>  
                </td>
                <td align="right">单据状态：</td>
                <td >    
                    <input name="txtCheckFlag" class="mini-textbox" readonly="readonly"style="width:150px;"/></td>
            </tr>
        </table>
    </div>
    <div class="mini-fit">
        <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" 
            showPager = "false" showPageSize="false" showPageIndex="false" skipReadOnlyCell="true"
            allowCellSelect="true" allowSortColumn = "false" allowCellEdit="true" navEditMode="true"
            editNextOnEnterKey="true"  editNextRowCell="false" oncelleditenter="onCelleditenter"  
            ondrawcell="onDrawCell" oncellcommitedit="onCellCommitEdit"  ondrawsummarycell="onDrawSummaryCell"
            showSummaryRow="true" onrowdblclick="onRowDblClick" fitColumns="false">
            <div property="columns">            
                <div type="indexcolumn" width="35" headerAlign="center" >序号</div>
                <div field="mFNumber" name="mFNumber" displayField = "mFNumber" width="120" headerAlign="center">商品编码
                <input property="editor" class="mini-buttonedit" onbuttonclick = "onButtonEditMy" onvaluechanged = "onValueChangedMy" style="width:100%;"/>
                </div>  
                <div field="mFName" name="mFName" width="160" headerAlign="center">商品名称</div>  
                <div field="mFModel" name="mFModel" width="100" headerAlign="center">规格型号</div>
                <div field="mFUnitName" name="mFUnitName" width="40" headerAlign="center">单位</div>
                <div field="mFScQty" name="mFScQty" numberFormat="#0.00" width="80" headerAlign="center" align="right" summaryType="sum">订单数量</div>                
                <div field="mFQty" name="mFQty" width="70" headerAlign="center" align="right">出库数量
                    <input property="editor" class="mini-spinner" maxValue="99999999" style="width:100%;"changeOnMousewheel ="false" showbutton="false" increment ="0" />
                </div>
                <div field="mFPrice" name="mFPrice" width="70" numberFormat="#0.00" headerAlign="center" align="right">单价
                    <input property="editor" class="mini-spinner" maxValue="99999999" style="width:100%;"changeOnMousewheel ="false" showbutton="false" increment ="0" />
                </div>
                <div field="mFAmount" name="mFAmount" numberFormat="#0.00" width="90" headerAlign="center" align="right" summaryType="sum">出库金额
                <input property="editor" class="mini-spinner" maxValue="99999999" style="width:100%;"changeOnMousewheel ="false" showbutton="false" increment ="0" />
                </div>                
                <div field="mFPurPrice" name="mFPurPrice" width="70" numberFormat="#0.00" headerAlign="center" align="right">采购单价</div>
                <div field="mFPurAmount" name="mFPurAmount" numberFormat="#0.00" width="80" headerAlign="center" align="right" summaryType="sum">采购金额</div>
                <div field="mFPosPrice" name="mFPosPrice" width="70" numberFormat="#0.00" headerAlign="center" align="right">零售单价</div>
                <div field="mFPosAmount" name="mFPosAmount" numberFormat="#0.00" width="80" headerAlign="center" align="right" summaryType="sum">零售金额</div>
                <div field="mFStockQty" name="mFStockQty" width="70" headerAlign="center" align="right">结存数量</div>
                <div field="mFCode" name="mFCode" width="120" headerAlign="center">商品条码</div>                
                <div field="mFRemark" name="mFRemark" headerCls="CellLast" width="150" headerAlign="center" >备注
                    <input property="editor" class="mini-textbox" style="width:100%;"/>
                </div>
            </div>
        </div>  

    </div>

     @Html.Partial("~/Views/Modular/Bill/Footer.cshtml")
       
      
    <input id="type" name="type" value="@ViewBag.type" type="hidden"/>
    <input id="FScBillID" name="FScBillID" class="mini-hidden"/>
    </form> 
    @Html.Partial("~/Views/Modular/Bill/ScanWin.cshtml")

    <!--menu-->
    <ul id="popupMenu" class="mini-menu" style="display:none;"> 
	    <li id ="ScanAdd" iconCls="icon-find" onclick="ScanAdd">扫描录入</li>        
        <li class="separator"></li>
        <li id ="uncheck" iconCls="icon-unlock" onclick="checkBillUn">反审核</li>
    </ul>

    <script type="text/javascript">
        mini.parse();
        var form = new mini.Form("form1");
        var grid = mini.get("datagrid1");      
        var uID = parent.window.getSystemAppID();
        var uCode = parent.window.getSystemAppCode();
        var uName = parent.window.getSystemAppName();
        var LastField = "mFRemark";
        var sumFields = "mFQty,mFAmount,mFPurAmount,mFPosAmount,mFScQty";

        $(function () {
            var oBox = document.getElementById("scan");
            var oBar = document.getElementById("title");
            if (id == 0)
                BillState(0);
            InitScan();
            startDrag(oBar, oBox);
            InitGrid("OutData");
        });

        //$(function () {
        //    var Iname = new Array(['FCode', 'FCount', 'FPrice']);
        //    var DText = new Array(['输入条码后回车或扫描条码到这里', '输入后回车', '输入后请按回车增加到下方表格中']);
        //    var tooltipObj = new DHTMLgoodies_formTooltip(Iname, DText);
        //    tooltipObj.setTooltipPosition('right');
        //    tooltipObj.setPageBgColor('#EEE');
        //    tooltipObj.setCloseMessage('关闭');
        //    tooltipObj.initFormFieldTooltip();
        //});

        var id = getQueryString("billid");
        if (id != null) {
            mini.getbyName("KInterID").setValue(id);
        }        
        var datatype = getQueryString("datatype");      

        LoadData();

        function LoadData() {
            var minterid = mini.getbyName("KInterID").value;
            $.ajax({
                url: '../Bill/GetBillData',
                data: { mSystemAppID: uID, mBillID: minterid, mDataType: datatype },
                dataType: 'text',
                async: false,
                success: function (text) {
                    var dataR = mini.decode(text);
                    grid.setData(dataR.datadetail);
                    if (dataR.datamaster.length > 0) {
                        var mdata = dataR.datamaster[0];
                        form.setData(mdata);
                        mini.getbyName("FCustItemID").setValue(mdata.FCustID);
                        mini.getbyName("FCustItemID").setText(mdata.FCustNumber);
                        mini.getbyName("FScBillNo").setValue(mdata.FScBillID);
                        mini.getbyName("FScBillNo").setText(mdata.FScBillNo);
                        mini.getbyName("FScBillID").setValue(mdata.FScBillID);
                        if (mdata.FCheckFlag == 1) {
                            BillState(2);
                            mini.get("ScanAdd").setEnabled(false);
                        }
                        else {
                            BillState(1);
                            if (minterid == 0)
                                mini.get("ScanAdd").setEnabled(true);
                            else
                                mini.get("ScanAdd").setEnabled(false);
                        }
                        if ((mdata.KInterID == "0") || (mdata.KInterID == null)) {
                            newBills();
                            mini.get("ScanAdd").setEnabled(true);
                        }
                    }
                    else {
                        newBills();
                    }
                }
            });
        }

        function newBills() {
            NewBill();
            var nowDate = new Date();
            mini.getbyName("FBillDate").setValue(nowDate);
            mini.getbyName("FDate").setValue(nowDate);
            mini.getbyName("FBillNo").setValue('');
            mini.getbyName("FRemark").setValue('');
            mini.getbyName("txtCheckFlag").setValue('');
            mini.get("ScanAdd").setEnabled(true);
            grid.updateColumn("mFNumber", { readOnly: false });
            mini.getbyName("FScBillNo").setValue("0");
            mini.getbyName("FScBillNo").setText("");
            mini.getbyName("FScBillID").setValue("0");
        }

        function modifys() {
            modify();
            mini.get("ScanAdd").setEnabled(true);
            mini.get("import").setEnabled(true);
            var FScBillID = mini.getbyName("FScBillID").getValue();
            if (FScBillID > 0) {
                grid.updateColumn("mFNumber", { readOnly: true });
                mini.get("addrow").setEnabled(false);
                mini.get("delrow").setEnabled(false);
                mini.get("ScanAdd").setEnabled(false);
                mini.get("import").setEnabled(false);
                mini.get("FScBillNo").setEnabled(false);
            }
            else {
                grid.updateColumn("mFNumber", { readOnly: false });
            }
        }

        function checkValid() {
            if ((mini.getbyName("FBillerID").getValue() == "") || (mini.getbyName("FBillerID").getValue() == "0")) {
                var newbillerid = parent.window.getSystemAppID();
                mini.getbyName("FBillerID").setValue(newbillerid);
            }

            var MainData = form.getData();
            if (MainData.FCustItemID.toString() == "") {
                mini.showTips({ content: "<b>保存失败</b> <br/>客户名称不能空值!", state: "danger", x: "center", y: "top", timeout: 3000 });
                return false;
            }
            return true;
        }

        function saveBill() {
            BillState(1);//先锁定
            mini.get("ScanAdd").setEnabled(false);
            if (checkValid() == false) {
                BillState(4);//先锁定
                mini.get("ScanAdd").setEnabled(true);
                return;
            }
            var MainData = form.getData();
            var cDate = mini.getbyName("FDate").getFormValue();
            var rCnt = grid.getData().length;
            var sBillNo = MainData.FBillNo;
            var sScBillNo = mini.getbyName("FScBillNo").getText();
            var mjson = "[{'KInterID':'" + MainData.KInterID + "',";
            mjson = mjson + "'FBillNo':'" + MainData.FBillNo + "',";
            mjson = mjson + "'FSystemAppID':'" + uID + "',";
            mjson = mjson + "'FCustID':'" + MainData.FCustItemID + "',";
            mjson = mjson + "'FScBillID':'" + MainData.FScBillID + "',";            
            mjson = mjson + "'FScBillNo':'" + sScBillNo + "',";
            mjson = mjson + "'FDate':'" + cDate + "',";
            mjson = mjson + "'FDataType':'" + datatype + "',";
            mjson = mjson + "'FRemark':'" + MainData.FRemark + "',";
            var json = "'goods_list':[";
            var datarow = 0;
            for (var i = 0; i < rCnt; i++) {
                var rs = grid.getRow(i);
                if (typeof (rs.mFNumber) == "undefined") continue;
                if (datarow > 0)
                    js = ",{";
                else
                    js = "{"
                js = js + '"mFItemID":' + rs.mFItemID + ",";
                var qty = typeof (rs.mFQty) == "undefined" ? 0 : rs.mFQty;
                js = js + '"mFQty":' + qty + ",";
                var price = typeof (rs.mFPrice) == "undefined" ? 0 : rs.mFPrice;
                js = js + '"mFPrice":' + price + ",";
                var money = typeof (rs.mFAmount) == "undefined" ? 0 : rs.mFAmount;
                js = js + '"mFAmount":' + money + ",";
                var mFScQty = typeof (rs.mFScQty) == "undefined" ? 0 : rs.mFScQty;
                js = js + '"mFScQty":' + mFScQty + ",";
                var mFScEntryID = typeof (rs.mFScEntryID) == "undefined" ? 0 : rs.mFScEntryID;
                js = js + '"mFScEntryID":' + mFScEntryID + ",";
                var mFScBillID = typeof (rs.mFScBillID) == "undefined" ? 0 : rs.mFScBillID;
                js = js + '"mFScBillID":' + mFScBillID + ",";
                var mFScBillNo = typeof (rs.mFScBillNo) == "undefined" ? "" : rs.mFScBillNo;
                js = js + '"mFScBillNo":"' + mFScBillNo + '",';
                var remark = typeof (rs.mFRemark) == "undefined" ? "" : rs.mFRemark;
                js = js + '"mFRemark":"' + remark + '"';
                js = js + "}"
                json = json + js;
                datarow = datarow + 1;
            }
            if (datarow == 0) {
                mini.showTips({ content: "<b>保存失败</b> <br/>没有要保存的数据!", state: "danger", x: "center", y: "top", timeout: 5000 });
                BillState(4);
                mini.get("ScanAdd").setEnabled(true);
                return false;
            }
            json = json + "]";
            mjson = mjson + json + "}]";
            $.ajax({
                url: '../Bill/SaveBillData_Out',
                data: { mdatajson: mjson },
                type: "post",
                cache: false,
                success: function (txt) {
                    var ret = mini.decode(txt);
                    if (ret.id > 0 && ret.FBillNo != '') {
                        mini.getbyName("KInterID").setValue(ret.id);
                        mini.getbyName("FBillNo").setValue(ret.FBillNo);
                        mini.showTips({ content: "<b>保存成功</b>", state: "success", x: "center", y: "top", timeout: 3000 });
                        BillState(1);
                        mini.get("ScanAdd").setEnabled(false);
                    }
                    else {
                        mini.alert("异常:" + ret.Status);
                    }
                },
                error: function (xhr) {
                    mini.alert("异常:" + xhr.responseText);
                }
            });
        }

        function onButtonEditMy(e) {
            ShowGoodsMy("");
        }

        function onValueChangedMy(e) {
            ShowGoodsMy(e.value);
        }

        function ShowGoodsMy(txtValue) {
            var sNumber = "";
            var sName = "";
            var pattern = new RegExp("[\u4E00-\u9FA5]+");
            var pattern3 = new RegExp("[0-9]+");
            if (pattern.test(txtValue)) {
                //alert('该字符串是中文');
                sName = txtValue;
            }
            else 
                if (pattern3.test(txtValue)) {
                    sNumber = txtValue;                    
                    //alert('该字符串是数字');
                } else {
                    sName = txtValue;
                }
            mini.get("save").setEnabled(true);
            var FObjectID = mini.getbyName("FCustItemID").getValue();
            var FStockID = 0;            
            var json = "[{";
            json = json + "'FClassID':" + "'0',";
            json = json + "'FObjectID':" + "'" + FObjectID + "',";
            json = json + "'FStockID':" + "'" + FStockID + "',";
            json = json + "'FBillType':" + "'" + datatype + "',";
            json = json + "'FSupplierID':" + "'-1',";
            json = json + "'FNumber':'" + sNumber + "',";
            json = json + "'FName':'" + sName + "',";
            json = json + "'FSystemAppID':'" + uID + "'}]";
            if ((txtValue != null) && (txtValue != "")) {
                $.post("../Bill/GetBillGoodss", { datajson: json }, function (data) {
                    var ret = mini.decode(data);
                    if (ret.data.length == 1) {
                        var row = grid.getSelected();
                        var action = ret.data[0];
                        var newaction = Extra({
                            mFItemID: action.FItemID, mFNumber: action.FNumber, mFName: action.FName, mFModel: action.FSpec,
                            mFUnitName: action.FUnitName, mFQty: row == null ? 0 : row.mFQty, mFPrice: action.FPrice, mFCode: action.FCode,
                            mFStockQty: action.FStockQty, mFPosPrice: action.FPosPrice, mFPurPrice: action.FPurPrice, mFQty_Pra: 0,
                            mFQty_DawOut: 0, mFEntryID_DawOut: 0, mFInterID_Pra: 0, mFEntryID_Pra: 0, mFInterID_DawOut: 0,
                            mFBillNO_Pra: '', mFBillNO_DawOut: ''
                        });
                        grid.updateRow(row, newaction);
                        if ((row.mFQty != "NaN") && (row.mFQty != 0)) {
                            grid.updateRow(row, {
                                mFAmount: row.mFQty * action.FPrice,
                                mFPurAmount: row.mFQty * action.FPurPrice,
                                mFPosAmount: row.mFQty * action.FPosPrice
                            });
                        }
                    }
                    else {
                        ShowGoodsWinMy(txtValue);
                    }
                });
            }
            else {
                ShowGoodsWinMy(txtValue);
            }
        }

        //选择商品表
        function ShowGoodsWinMy(txtValue) {
            var FObjectID = mini.getbyName("FCustItemID").getValue();
            var FStockID = 0;            
            mini.open({
                url: "../Bill/GetBillGoods",
                title: "选择商品", width: 900, height: 500,
                onload: function () {
                    var iframe = this.getIFrameEl();
                    var data = { key: txtValue, mBillType: datatype, mStockID: FStockID, FObjectID: FObjectID };
                    iframe.contentWindow.SetData(data);
                },
                ondestroy: function (action) {
                    if (action) {
                        var row = grid.getSelected();
                        for (var i = 0, l = action.length; i < l; i++) {
                            var rw = action[i];
                            if (typeof (row.mFItemID) != "undefined") {
                                var ix = grid.indexOf(row);
                                ix++;
                                if (ix >= grid.getData().length) {
                                    var newRow = {
                                        mFItemID: rw.FItemID, mFNumber: rw.FNumber, mFName: rw.FName, mFModel: rw.FSpec,
                                        mFUnitName: rw.FUnitName, mFQty: 0, mFPrice: rw.FPrice, mFCode: rw.FCode,
                                        mFStockQty: rw.FStockQty, mFPosPrice: rw.FPosPrice, mFPurPrice: rw.FPurPrice, mFQty_Pra: 0,
                                        mFQty_DawOut: 0, mFEntryID_DawOut: 0, mFInterID_Pra: 0, mFEntryID_Pra: 0, mFInterID_DawOut: 0,
                                        mFBillNO_Pra: '', mFBillNO_DawOut: ''
                                    };
                                    grid.addRow(Extra(newRow), grid.getData().length);
                                    row = grid.getRow(ix);
                                }
                                else {
                                    row = grid.getRow(ix);
                                    grid.cancelEdit();
                                    grid.updateRow(row, Extra({
                                        mFItemID: rw.FItemID, mFNumber: rw.FNumber, mFName: rw.FName, mFModel: rw.FSpec,
                                        mFUnitName: rw.FUnitName, mFQty: 0, mFPrice: rw.FPrice, mFCode: rw.FCode,
                                        mFStockQty: rw.FStockQty, mFPosPrice: rw.FPosPrice, mFPurPrice: rw.FPurPrice, mFQty_Pra: 0,
                                        mFQty_DawOut: 0, mFEntryID_DawOut: 0, mFInterID_Pra: 0, mFEntryID_Pra: 0, mFInterID_DawOut: 0,
                                        mFBillNO_Pra: '', mFBillNO_DawOut: ''
                                    }));
                                }
                            }
                            else {
                                grid.cancelEdit();
                                var arow = {
                                    mFItemID: rw.FItemID, mFNumber: rw.FNumber, mFName: rw.FName, mFModel: rw.FSpec,
                                    mFUnitName: rw.FUnitName, mFQty: 0, mFPrice: rw.FPrice, mFCode: rw.FCode,
                                    mFStockQty: rw.FStockQty, mFPosPrice: rw.FPosPrice, mFPurPrice: rw.FPurPrice, mFQty_Pra: 0,
                                    mFQty_DawOut: 0, mFEntryID_DawOut: 0, mFInterID_Pra: 0, mFEntryID_Pra: 0, mFInterID_DawOut: 0,
                                    mFBillNO_Pra: '', mFBillNO_DawOut: ''
                                };
                                var newRow = Extra(arow);
                                grid.updateRow(row, newRow);
                            }
                        }
                    }
                }
            });
        }


        function onGetSourceBill() {
            mini.open({
                url: "../Bill/FindBill",
                title: "查看单据", width: 900, height: 530,
                onload: function () {
                    var iframe = this.getIFrameEl();
                    var data = { BillKind: "2008" };
                    iframe.contentWindow.SetData(data);
                },
                ondestroy: function (action) {
                    if (action) {
                        if ((action.KInterID == null) || (action.KInterID == "undefined")) return;
                        mini.getbyName("FScBillNo").setValue(action.KInterID);
                        LoadDataFromOrder();
                    }
                }
            });
        }

        function LoadDataFromOrder() {
            var minterid = mini.getbyName("FScBillNo").value;
            $.ajax({
                url: '../Bill/GetBillData',
                data: { mSystemAppID: uID, mBillID: minterid, mDataType: "2008" },
                dataType: 'text',
                async: false,
                success: function (text) {
                    var dataR = mini.decode(text);
                    grid.setData(dataR.datadetail);
                    if (dataR.datamaster.length > 0) {
                        var mdata = dataR.datamaster[0];
                        form.setData(mdata);
                        mini.getbyName("KInterID").setValue("0");
                        mini.getbyName("FBillNo").setValue("");
                        mini.getbyName("FCustItemID").setValue(mdata.FCustID);
                        mini.getbyName("FCustItemID").setText(mdata.FCustNumber);
                        mini.getbyName("FCustName").setValue(mdata.FCustName);
                        mini.getbyName("FScBillNo").setValue(mdata.KInterID);
                        mini.getbyName("FScBillNo").setText(mdata.FBillNo);
                        mini.getbyName("FScBillID").setValue(mdata.KInterID);
                        grid.updateColumn("mFNumber", { readOnly: true });
                        BillState(4);
                        mini.get("addrow").setEnabled(false);
                        mini.get("delrow").setEnabled(false);
                        mini.get("ScanAdd").setEnabled(false);
                        mini.get("import").setEnabled(false);
                    }
                }
            });
        }

    </script>
</body>